﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    x:Class="QuickMail.ResourceDictionary">

    <Style x:Key="AttachmentButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Width" Value="20"/>
        <Setter Property="Height" Value="20"/>
        <Setter Property="Margin" Value="0, 5"/>
        <Setter Property="Opacity" Value="0.7"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Image Source="Resources/attach-32.png"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Opacity" Value="0.9"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Opacity" Value="1"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="FileButtonStyle" TargetType="Button">
        <EventSetter Event="Click" Handler="FileOpen_OnClick"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border Background="#00FFFFFF" Margin="5, 0" Width="100" ToolTip="{TemplateBinding ToolTip}">
                        <!--<ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter>-->
                        <StackPanel Orientation="Vertical">
                            <Image x:Name="FileIcon" Source="{TemplateBinding Tag}" Width="48" Height="48" Opacity="0.9"/>
                            <TextBlock x:Name="FileNameTextBlock" Text="{TemplateBinding Content}"  Foreground="White"
                                           TextTrimming="CharacterEllipsis" TextWrapping="Wrap" FontWeight="DemiBold"
                                           TextAlignment="Center" HorizontalAlignment="Center" MaxHeight="40"/>
                        </StackPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="FileIcon" Property="Opacity" Value="1"/>
                            <Setter TargetName="FileNameTextBlock" Property="TextDecorations" Value="Underline"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="FileIconStyle" TargetType="Image">
        <Setter Property="Width" Value="48"/>
        <Setter Property="Height" Value="48"/>
        <Setter Property="Opacity" Value="0.9"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Opacity" Value="1"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <Style x:Key="FileNameStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="FontWeight" Value="DemiBold"/>
        <Setter Property="TextAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="MaxHeight" Value="40"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="TextDecorations" Value="Underline"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Storyboard x:Key="FadeIn">
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                           Storyboard.TargetName="BalloonGrid"
                                           Storyboard.TargetProperty="(UIElement.Opacity)">
            <SplineDoubleKeyFrame KeyTime="00:00:00"
                                      Value="0" />
            <SplineDoubleKeyFrame KeyTime="00:00:01"
                                      Value="0.95" />
            <SplineDoubleKeyFrame KeyTime="00:00:03"
                                      Value="0.95" />
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="FadeBack">
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                           Storyboard.TargetName="BalloonGrid"
                                           Storyboard.TargetProperty="(UIElement.Opacity)">
            <SplineDoubleKeyFrame KeyTime="00:00:00"
                                      Value="1" />
            <SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
                                      Value="1" />
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <!--<Storyboard x:Key="FadeOut" Completed="OnFadeOutCompleted">-->
    <Storyboard x:Key="FadeOut">
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                           Storyboard.TargetName="BalloonGrid"
                                           Storyboard.TargetProperty="(UIElement.Opacity)">
            <SplineDoubleKeyFrame KeyTime="00:00:00"
                                      Value="1" />
            <SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
                                      Value="0.2" />
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
</ResourceDictionary>